<me:UIGABEW x:Class="WPFExcelReport.TEKGB14"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBBST"  
                    xmlns:GPD="clr-namespace:WPFExcelReport;assembly=TGPDAT"  
                    xmlns:EKP="clr-namespace:WPFExcelReport;assembly=TEKPOS"  
                    xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    FontSize="16"
                    x:Name="TV"
                    Loaded="Window_Loaded"
                    FTAUTOSUM="True"
                    SKEY1="WBEWMANDANT" 
                     KEY1="WBEWMTR"
                    TKEY1="总长度"
                    TCOUNT1="总卷数"
     >
    <me:UIGABEW.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:M2YD x:Key="m2yd"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIGABEW.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="3*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=采购单:}}"></TextBlock>
                    <WrapPanel  Grid.Column="1" >
                        <ex:TXT72  PRE="  " MaxLength="2"   Text="{Binding KRS, ElementName=TV}" Width="40"/>
                        <ex:TXT72 PRE="000000" MaxLength="6"  Text="{Binding LFD, ElementName=TV}" Width="60"/>
                        <ex:TXT72 PRE="000" MaxLength="3" Text="{Binding POS, ElementName=TV}" Width="60"/>
                    </WrapPanel>
                </Grid>
                <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=编号:}}"></TextBlock>
                    <TextBlock Grid.Column="1" Text="{Binding BELEG}"/>
                </Grid>
            </WrapPanel>
            <WrapPanel >
                <Button  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <Button  Click="EditCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                    </Button.Background>
                </Button>
                <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>

                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=库位:}}"></TextBlock>
                        <CheckBox  Grid.Column="1" Name="cWH"></CheckBox>
                        <WrapPanel  Grid.Column="2" >
                            <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LO, ElementName=TV}" Width="40"/>
                            <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LB, ElementName=TV}" Width="60"/>
                            <ex:TXT72  MaxLength="8" CharacterCasing="Upper"  Text="{Binding LP, ElementName=TV}" Width="60"/>
                            <WH:TSWH  KEY="{Binding WH,ElementName=TV}" Visibility="{Binding IsChecked,ElementName=cWH,Converter={StaticResource bv}}"/>
                        </WrapPanel>
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=布卷数:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"  Text="{Binding ROLLS, ElementName=TV}" Width="40"/>
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=大多数布卷的长度:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"  DecimalPlaces="1" Text="{Binding RLG, ElementName=TV}" Width="80"/>
                        <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=M}}"></TextBlock>
                        <ex:NumericBox  Grid.Column="3" DecimalPlaces="1"  Text="{Binding RLG, ElementName=TV,Converter={StaticResource m2yd}}" Width="80"/>
                        <TextBlock   Grid.Column="4" Text="{Binding Source={Localization:Translate Word=YD}}"></TextBlock>
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=目标长度:}}"></TextBlock>
                        <TextBlock Grid.Column="1"  Text="{Binding TLG, ElementName=TV}" Width="120"/>
                        <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=M}}"></TextBlock>
                        <TextBlock  Grid.Column="3"  Text="{Binding TLG, ElementName=TV,Converter={StaticResource m2yd}}" Width="120"/>
                        <TextBlock   Grid.Column="4" Text="{Binding Source={Localization:Translate Word=YD}}"></TextBlock>
                    </Grid>
                    <Button  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <WrapPanel>
                    <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=确认入库}}"/>
                    </Grid>
                </WrapPanel>
            </WrapPanel>
            <EKP:TEK05 Name="cEKP" ORDERNUM="{Binding EXAUF,ElementName=TV}" 
                       dwEKP="{Binding dwEKP,ElementName=TV}"/>
            <GPD:TGB04 Name="cWB03"
                      Height="100"
                      EXAUF="{Binding EXAUF,ElementName=TV}" 
                      KEY="{Binding PARTIE,ElementName=TV}"
                      />
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=确认入库清单后，请选择预留的销售单，会自动完成留位操做}}"></TextBlock>
            <MU:TEKMU Grid.Row="1" Name="cMU" 
                      IsAuto="False"
                      ORDERNUM="{Binding KEY,ElementName=cEKP}"/>

        </Grid>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <WrapPanel Grid.Column="0">
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button  Click="NewWBCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=手工插入:}}"></TextBlock>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button  Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=删除布卷:}}"></TextBlock>
                        </Grid>
                        <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                            <Grid Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=长度:}}"></TextBlock>
                                <ex:NumericBox Grid.Column="1"  DecimalPlaces="1" Text="{Binding RLG, ElementName=TV}" Width="80"/>
                                <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=M}}"></TextBlock>
                                <ex:NumericBox  Grid.Column="3" DecimalPlaces="1"  Text="{Binding RLG, ElementName=TV,Converter={StaticResource m2yd}}" Width="80"/>
                                <TextBlock   Grid.Column="4" Text="{Binding Source={Localization:Translate Word=YD}}"></TextBlock>
                            </Grid>
                            <Button  Click="NewWBCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                    </WrapPanel>
                    <TextBlock Grid.Column="1" Text="{Binding INFO,ElementName=TV}" />
                </Grid>
                <WrapPanel>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button  Click="ChgLGCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Refresh.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=修改长度:}}"></TextBlock>
                    </Grid>
                    <WrapPanel Visibility="{Binding IsChgWB,ElementName=TV,Converter={StaticResource bv}}">
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=长度:}}"></TextBlock>
                            <ex:NumericBox Grid.Column="1"  DecimalPlaces="1" Text="{Binding RLG, ElementName=TV}" Width="80"/>
                            <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=M}}"></TextBlock>
                            <ex:NumericBox  Grid.Column="3" DecimalPlaces="1"  Text="{Binding RLG, ElementName=TV,Converter={StaticResource m2yd}}" Width="80"/>
                            <TextBlock   Grid.Column="4" Text="{Binding Source={Localization:Translate Word=YD}}"></TextBlock>
                        </Grid>
                        <Button  Click="ChgLGCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=日期:}}"></TextBlock>
                    <TextBlock Text="{Binding WBEWBUCHDAT,Source={StaticResource vwMaster}}"/>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=时间:}}"></TextBlock>
                    <TextBlock Text="{Binding WBEWBUCHUHR,Source={StaticResource vwMaster}}"/>
                </WrapPanel>

            </StackPanel>
            <DataGrid  Grid.Row="1"  Grid.Column="0"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"                    >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=WBEWSTKNR}" Header="{Binding Source={Localization:Translate Word=布卷}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=WBEWMTR,Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=长度}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=WBEWAUFKRS}" Header=""  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=WBEWAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=采购单}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=WBEWAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />

                </DataGrid.Columns>
            </DataGrid  >
            <ex:TPage  Grid.Row="2" Grid.Column="0" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
            <WrapPanel  Grid.Row="3" Grid.Column="0">
                <ex:TSUMWB/>
                <GPD:TGB04 IsCanNew="False" IsCanChg="False" 
                           IsCanCopy="False" IsCanDelete="False"
                           ORDERNUM="{Binding KEY,ElementName=cWB03}"
                           />
            </WrapPanel>
            <WB:TWB25 Grid.Row="1" Grid.RowSpan="10" Grid.Column="1" 
             Name="cWB"
             IsPage="True"
             Rows="50"
             FTAUTOWB="False" 
             FTAUTOSUM="True"
             SKEY1="WBBART" 
             KEY1="WBBISTKLG"
             TKEY1="总长度" 
             TBWB="{Binding TBWB,ElementName=TV}" 
             IsBusy="{Binding IsBusy,ElementName=TV}" 
             RWAUF="{Binding KEY,ElementName=cWB03}" 
             />
            <WB:TEKWZVK09 Grid.Row="1" Grid.RowSpan="10"   Grid.Column="2"  Visibility="Collapsed"
                          FTAUTOSUM="True"
                         SKEY1="WBBART" 
                         KEY1="WBBISTKLG"
                         TKEY1="总长度" 
                         RWAUF="{Binding KEY,ElementName=cWB03}"
                         EKPMU="{Binding EKPMU,ElementName=cMU}"
                          />

        </Grid>

    </Grid>
</me:UIGABEW>
